package org.alex.samples.service;

import java.util.List;

import org.alex.samples.dao.IUserDAO;
import org.alex.samples.model.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserServiceImpl implements IUserService {
	
	@Autowired
	private IUserDAO userDAO;
	
	@Override
	public List<User> findAllUsers(){
		return userDAO.findAllUsers();
	}

	@Override
	public User getUserById(int id) {
		return userDAO.getUserById(id);
	}

	@Override
	public void editUser(User user) throws Exception {
		userDAO.editUser(user);
		
	}

	@Override
	public void createUser(User user) throws Exception {
		// TODO Auto-generated method stub
		userDAO.createUser(user);
	}

	@Override
	public void deleteUser(int id) throws Exception {
		// TODO Auto-generated method stub
		userDAO.deleteUser(id);
	}
}
